<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script>
var a = ["abc8945890", "aiii", "aa", "bnb", "fladsjfl", "ewru90"]
a.sort(function (a, b){
    return -a.length + b.length;
});
console.log(a);
</script>
</body>
</html>